<?php

require_once(LIB_PATH.'/libRVT.php');

$rvt = new RVT();

if ( isset($_POST['items']) ){
	$items = array();
	foreach (explode('+',$_POST['items']) as $item)
		$items = array_merge($items, $rvt->exploitDisks($item));
	$items = array_unique($items);
	
	$xml = new XMLReader();
	$xml->open(INC_PATH.'/scripts.xml');
	$info = xml2assoc($xml);
	$xml->close();
	
	$scripts=array();
	foreach ($info[0]['value'] as $sc){
		$tmp=array();
		foreach ($sc['value'] as $p){
			$tmp[$p['tag']]=$p['value'];
		}
		$scripts[]=$tmp;
	}
	
	$smarty->assign('scripts',$scripts);
	if (count($items) != 0) $smarty->assign('items',$items);
}


$smarty->display($_POST['mod'].'.tpl');

?>
